define(['config/appregister',"business/home/services/booksService"],function(app,booksService){
	app.controller('homeCtrl', function($scope,$state,booksService){
		$scope.str = 'home page';
        $scope.sex = 0;
        $scope.state = {
            "indexCtrl":"indexCtrl",
            "eng":"eng.main",
            "techDetail":"techdetail",
            "newsDetail":"newsDetail",
            "select":"uploadSelectFile",
            "vedio":"vedio",
            "vedioDetails":"vedioDetails",
            "login":"login",
            "loginCtrl2":"login2",
            "BackPwd":"BackPwd",
            "regPwd":"regPwd",
            "videoPlay":"videoPlay",
            "regPwdSuccess":"regPwdSuccess",
            "registerSucess":"registerSucess",
            "newsCtrl":"news2",
            "loginEnd":"loginEnd",
            "BindEmail":"BindEmail",
            "logined":"logined",
            "loginedEmail":"loginedEmail",
            "loginedReseted":"loginedReseted",
            "loginedReset":"loginedReset",
            "loginedBind":"loginedBind",
            "loginedBack":"loginedBack",
            "prosonMine":"prosonMine",
		"homepage":"homepage",
		"myaccount":"myaccount",
	    "homepageCtrl":"homepageCtrl",
	    "workListCtrl":"workListCtrl",
	     "workDetailsCtrl":"workDetailsCtrl",
	    "introduceCtrl":"introduceCtrl",
	    	"postbardeta":"postbardeta",
   		"iask":"iask",
   		"wikilist":"eng.wikilist",
        "commpanyVideoCtrl":"commpanyVideoCtrl",
            "VideomodifyCtrl":"VideomodifyCtrl",
            "comIndexCtrl":"comIndexCtrl",
	    "blogpost":"blogpost",
	    "cpedit":"cpedit",

	    "outIndexCtrl":"outIndexCtrl",
	    "zpdetailCtrl":"zpdetailCtrl",
	    "engdepCtrl":'engdepCtrl',
	    "callBackCtrl":"callBackCtrl",

	    "enterprisereg":"enterprisereg",
		"enterpriselogin":"enterpriselogin",
		"bloglist":"bloglist",
		"blogxq":"blogxq",
		"blogmod":"blogmod",
		"enterpriseback":"enterpriseback",
		"emailmodify":"emailmodify",
		"oneself":"oneself",
		"tourist":"tourist",
		"special":"special",
            "showData":{
                state:"showData",
                toParams:{city:"shanghai",parts:"pudong",id:3456,username:"jackMa"}
            }
        };
        $scope.routerChange = function(state){
            if(angular.isObject(state.toParams)){
                $state.go(state.state,state.toParams);
            }else{
                $state.go(state,{},{reload:true});
            }
        }
        $scope.books = booksService.books;
	})

    app.filter('sexFilter', function(){
        return function(sex){
            return ['男','女'][sex];
        }
    })
    app.directive('myDirective', function(){
        return {
            restrict: "E",
            replace: true,
            template: "<div><span>指令测试</span></div>"
        }
    })
})